#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <cmath>
using namespace std;
#define ldb long double
#define ll long long
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define ff first
#define ss second
#define nextLine() {int c = 0; while ((c = getchar()) != 10 && c != EOF); }
const ldb pi = fabsl(atan2l(0.0, -1.0));
const ldb eps = 1e-9;
const int inf = 1 << 28;


void load()
{

}

ll check(int a, int y, int k)
{
	return (ll)(a + 1) * (ll)(min(y - 1, k) + 1);
}

ll count2(int k, int y, int z)
{
	ll res = check(0, z, k);
	res = max(res, check(min(k, y - 1), z, k - min(k, y - 1)));
	res = max(res, check(0, y, k));
	res = max(res, check(min(k, z - 1), y, k - min(k, z - 1)));
	for (int t = k / 2 - 2; t <= k / 2 + 2; t++)
	{
		if (t >= 0 && t <= k && t < y)
			res = max(res, check(t, z, k - t));
	}
	return res;
}

void solve()
{
	int x, y, z, k;
	cin >> x >> y >> z >> k;
	ll res = 0;
	for (int a = 0; a < x && a <= k; a++)
	{                         
		res = max(res, ((ll)a + 1) * count2(k - a, y, z));
	}
	cout << res;

}

#define file "a"

int main()
{
	#ifndef ONLINE_JUDGE
		freopen(file".in", "rt", stdin);
		freopen(file".out", "wt", stdout);
  	#endif
  	load();
  	solve();
  	return 0;
}
